package cz.muni.fi.pa165.sme.web.converters;

import cz.muni.fi.pa165.sme.api.to.SportActivityTO;
import cz.muni.fi.pa165.sme.web.fo.SportActivityFO;
import org.springframework.core.convert.converter.Converter;

/**
 * @author jirankova
 */
public class SportActivityFO2SportActivityTOConverter implements Converter<SportActivityFO, SportActivityTO> {

	@Override
	public SportActivityTO convert(final SportActivityFO source) {
		if (source == null) {
			return null;
		}

		final SportActivityTO target = new SportActivityTO();

		target.setId(source.getId());
		target.setSpeed(source.getSpeed());
		target.setTitle(source.getTitle());

		return target;
	}
}
